//<template>
  <div>
      <p>评论：<input type="text" v-model="content"></p>
      <p><button @click="po()">评论</button></p>
  </div>
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return{
            content:'',
            id:this.$route.params.id
        }
    },
    methods:{
        po(){
            let form_data = new FormData()
            form_data.append('content',this.content)
            form_data.append('id',this.id)
            axios({
                url:'http://127.0.0.1:8000/app04/comment/',
                method:'post',
                data:form_data
            }).then(res=>{
                console.log(res.data)
            })
        }
    }
}
</script>

<style>

</style>